// 设置组件的可触发事件
import dateRange from './dateRange/dateRangeEvent';
import timeRange from './timeRange/timeRangeEvent';
import singleCheckbox from './singleCheckbox/singleCheckboxEvent';
import vueQuillEditor from './quillEditor/vueQuillEditorEvent';
import anvilDialog from './anvilDialog/anvilDialogEvent';
import userSelector from './userSelector/userSelectorEvent';
import companySelector from './companySelector/companySelectorEvent';
import deptSelector from './deptSelector/deptSelectorEvent';
import jobSelector from './jobSelector/jobSelectorEvent';
import roleSelector from './roleSelector/roleSelectorEvent';
import anvilTable from './anvilTable/anvilTableEvent';
import anvilDrawer from './anvilDrawer/anvilDrawerEvent';
import treeSelect from './treeSelect/treeSelectEvent';
import dynamicTree from './dynamicTree/dynamicTreeEvent';
import imgViewer from './imgViewer/imgViewerEvent';
import paragraph from './paragraph/paragraphEvent';
import simpleUploader from './simpleUploader/simpleUploaderEvent';
import anvilTabs from './tabs/anvilTabsEvent';
import videoPlayer from './videoPlayer/videoPlayerEvent';
import { getLocalCompEvents } from '@/components/Code';

const common = [
  {
    label: '当内容修改时',
    value: 'change',
    desc: '文本内容改变时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  },
  {
    label: '当点击输入框时',
    value: 'click',
    desc: '输入框被点击时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  }
];

const input = [
  ...common,
  {
    label: '当失去焦点时',
    value: 'blur',
    desc: '失去焦点时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  },
  {
    label: '当获得焦点时',
    value: 'focus',
    desc: '获得焦点时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  },
  {
    label: '当点击头部文本时',
    value: 'prependClick',
    desc: '点击头部文本时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  },
  {
    label: '当点击尾部文本时',
    value: 'appendClick',
    desc: '点击尾部文本时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  }
];

const textarea = [
  ...common,
  {
    label: '当失去焦点时',
    value: 'blur',
    desc: '失去焦点时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  },
  {
    label: '当获得焦点时',
    value: 'focus',
    desc: '获得焦点时触发',
    paramIn: '{column,value}',
    paramOut: '无'
  }
];

const upload = [
  {
    label: '当文件预览前',
    value: 'uploadPreview',
    desc: '文件预览前触发',
    paramIn: 'file,column,done',
    paramOut: '无'
  },
  {
    label: '当文件删除前',
    value: 'uploadDelete',
    desc: '文件删除前触发,参数为上传的文件和文件列表，若返回 false 或者返回 Promise 且被 reject，则停止删除',
    paramIn: 'file,column',
    paramOut: '无'
  },
  {
    label: '当文件上传限制后',
    value: 'uploadExceed',
    desc: '文件上传限制后触发',
    paramIn: 'limit,files,fileList,column',
    paramOut: '无'
  },
  {
    label: '当文件上传失败后',
    value: 'uploadError',
    desc: '文件上传失败后触发',
    paramIn: 'error,column',
    paramOut: '无'
  }
];

export default {
  input,
  textarea,
  select: textarea,
  password: input,
  number: common,
  checkbox: common,
  radio: common,
  date: common,
  time: common,
  datetime: common,
  switch: common,
  upload,
  dateRange,
  timeRange,
  singleCheckbox,
  vueQuillEditor,
  anvilDialog,
  userSelector,
  companySelector,
  deptSelector,
  jobSelector,
  roleSelector,
  anvilTable,
  anvilDrawer,
  treeSelect,
  dynamicTree,
  imgViewer,
  paragraph,
  simpleUploader,
  anvilTabs,
  videoPlayer,
  ...getLocalCompEvents
};
